from classtools import AttrDisplay

class  Person(AttrDisplay):
    def __init__(self,name,job=None,pay=0) -> None:
        self.name = name
        self.job = job
        self.pay = pay

    def lastName(self):
        return self.name.split()[-1]

    def giveRaise(self, percent):
        self.pay = int(self.pay*(1+percent))

class Manager(Person):
    def __init__(self, name, pay=0) -> None:
        Person.__init__(self,name, 'Mgr', pay)    

    def giveRaise(self, percent, bonus=0.10):
        Person.giveRaise(self, percent+bonus)        


if __name__=='__main__':
    bob = Person('Bob Smith')
    sue = Person('Sue Jones', job='dev', pay=10000)
    print(bob)
    print(sue)
    print(bob.lastName(), sue.lastName())
    sue.giveRaise(0.10)
    print(sue)
    tom=Manager('Tome Jones', 5000)
    tom.giveRaise(0.10)
    print('---All three---')
    for obj in (bob,sue,tom): 
        obj.giveRaise(.10)
        print(obj)